博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Octopus系列之各个页面调用示例
阅读量:7078 次
发布时间:2019-06-28

本文共 13073 字,大约阅读时间需要 43 分钟。

调用首页产品

可选参数如下

New = 1,

Hot = 2,
Best = 3,
Special = 4,
Featured = 5,
Other = 6

#foreach($item in $oct.GetProductstList(${currency},6,$ptype.Best))                                    
${item.name}
${item.NormalPrice}
${item.SalePrice}
Save:${item.Saveoff} off
#end
View Code

列表页 调用面包屑导航

            

调用全部分类【支持无限级的调用,根据需要自己编写】 下面展示4级分类的调用

                
#foreach($item in $categorylist)
${item.name} #foreach($s in $item.SubClass) #beforeall
    #each
  • ${s.name} #foreach($o in $s.SubClass) #beforeall
      #each
    • ${o.name} #foreach($p in $o.SubClass) #beforeall
      #end
    • #afterall
    #end
  • #afterall
#nodata #end
#end

很长看不懂吗?很简单 自己运行一下

调用产品列表

                   
#set($count=0) #foreach($item in $productlist) #set($count=$count+1)
${item.NormalPrice}
${item.SalePrice}
Save:${item.Saveoff} off
#if($count%3==0)
#end #end
${pager}

关于分页的样式,已经内置几种样式可以自己定义

调用详情页面包屑【和分页的有点细微差别】

                      

【通过产品的category对象来调用】

调用产品的多选属性

                              
#foreach($item in $product.Attributes) #if($item.type=="attr_radio")
$item.Name
#foreach($a in $item.values)
$a.value $oct.CheckValue($a.Pricefix) $a.DVPrice #end
#end #if($item.type=="attr_dropdown")
$item.Name
#end #if($item.type=="attr_color_radio")
$item.Name
#foreach($a in $item.values)
#end
#end #if($item.type=="attr_text")
#foreach($a in $item.values)
$item.Name:
#end
#end #end

这个大家还是自己看吧 【懒得口舌了,想要之后可以私下联系我,如果更新了 我会在上面更新的】

其实之所以这样贴出来是为了大家方便,其实Octopus完全支持自定义的模板开发的 不过你要完全熟悉我的对象实体 才行

调用关联产品

                            
#foreach($rp in $product.Related)
#end

调用上一个产品下一个产品

                         

调用收藏夹

                               #if(${islogin})                                                    #if(${iswishlist})                                                                                                                                                                    ${Oct_Favorite}                                                                                                        #else                                                                                                                                                                    ${Oct_Favorite}                                                                                                        #end                                                    #else                                                                                                            Favorite                                                                                                        #end

调用产品放大镜

                          
#foreach($img in $product.images.imagelist)
Thumbnail 0 #end

调用随机产品

                              #foreach($item in $oct.GetRandomProductList(${currency},3))                                                    
$item.name
$item.name
${item.NormalPrice}
${item.SalePrice}
Save:${item.Saveoff} off
#end

调用函数

字符截取

$oct.CutString("${item.ProductID}+${item.name}",45)

$oct.CutUrl(${siteurl})

转载于:https://www.cnblogs.com/Sky-cloudless/p/4470468.html

你可能感兴趣的文章
Vue性能优化:如何实现延迟加载和代码拆分?
查看>>
小米大数据:借助Apache Kylin打造高效、易用的一站式OLAP解决方案
查看>>
2019年Java和JVM生态系统预测:OpenJDK将成为Java运行时市场领导者
查看>>
Peter Cnudde谈雅虎如何使用Hadoop、深度学习和大数据平台
查看>>
Spark Streaming 作者,Alluxio 的创始人李浩源:AI 潮流对做数据存储业务公司的挑战...
查看>>
阿里宣布开源Flutter应用框架Fish Redux!
查看>>
与Andrey Breslav谈论Kotlin 1.0的发布
查看>>
多链跨链、高可用、高安全性的区块链应用如何落地? 金链盟大赛10强揭晓
查看>>
京东购物在微信等场景下的算法应用实践
查看>>
取代ZooKeeper!高并发下的分布式一致性开源组件StateSynchronizer
查看>>
Node.js 10.0和NPM 6发布,强化安全性
查看>>
关于Neo4j 强连通分量算法,你了解多少?
查看>>
Fake 5提供.NET Core支持
查看>>
Mozilla开发全新的公开网络API WebXR 来实现增强现实
查看>>
Visual Studio 2017 15.9预览版3支持ARM64 for UWP
查看>>
LLVM3.8停止了旧Windows版本,取消Autoconf,改进Clang
查看>>
HTTP将死?又拍云布局HTTPS 护航网页安全加速
查看>>
Microsoft 365及应用开发的未来:微软BUILD 2018大会第二天主题演讲
查看>>
白话中台战略:中台是个什么鬼?
查看>>
Java值类型设计进展
查看>>